package com.xgk.boot.module.core.controller.admin.account;

import cn.hutool.core.collection.CollUtil;
import com.xgk.boot.framework.apilog.core.annotation.ApiAccessLog;
import com.xgk.boot.framework.common.enums.CommonStatusEnum;
import com.xgk.boot.framework.common.pojo.CommonResult;
import com.xgk.boot.framework.common.pojo.PageParam;
import com.xgk.boot.framework.common.pojo.PageResult;
import com.xgk.boot.framework.common.util.object.BeanUtils;
import com.xgk.boot.framework.excel.core.util.ExcelUtils;
import com.xgk.boot.module.core.controller.admin.account.vo.OrderStatVO;
import com.xgk.boot.module.core.controller.admin.user.vo.user.*;
import com.xgk.boot.module.core.convert.user.UserConvert;
import com.xgk.boot.module.core.dal.entity.dept.DeptDO;
import com.xgk.boot.module.core.dal.entity.user.AdminUserDO;
import com.xgk.boot.module.core.enums.common.SexEnum;
import com.xgk.boot.module.core.service.dept.DeptService;
import com.xgk.boot.module.core.service.truck.TruckOrdersServiceImpl;
import com.xgk.boot.module.core.service.user.AdminUserService;
import com.xgk.boot.module.core.service.user.UserServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import static com.xgk.boot.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static com.xgk.boot.framework.common.pojo.CommonResult.success;
import static com.xgk.boot.framework.common.util.collection.CollectionUtils.convertList;

@Tag(name = "管理后台 - 账号中心")
@RestController
@RequestMapping("/system/account")
@Validated
public class AccountController {

    @Resource
    private TruckOrdersServiceImpl truckOrdersService;



    @GetMapping("/stat")
    @Operation(summary = "获取账号统计信息")
    public CommonResult<OrderStatVO> getAccountStat() {
        OrderStatVO orderStat = truckOrdersService.getOrderStat();
        if (orderStat == null) {
            return success(new OrderStatVO());
        }
        return success(orderStat);
    }



//    @DeleteMapping("/delete/{id}")
//    @Operation(summary = "删除用户")
//    @Parameter(name = "id", description = "编号", required = true, example = "1024")
//    @PreAuthorize("@ss.hasPermission('system:admin')")
//    public CommonResult<Boolean> deleteUser(@PathVariable("id")  Long id) {
//        userService.deleteUser(id);
//        return success(true);
//    }
//
//    @PutMapping("/update-password")
//    @Operation(summary = "重置用户密码")
//    @PreAuthorize("@ss.hasPermission('system:admin')")
//    public CommonResult<Boolean> updateUserPassword(@Valid @RequestBody UserUpdatePasswordReqVO reqVO) {
//        adminUserService.updateUserPassword(reqVO.getId(), reqVO.getPassword());
//        return success(true);
//    }


}
